#!/bin/zsh
# 进入目录

cd /Users/binny/demo/pplvc

ls -d */ | awk ' {print $1}' |  xargs echo


for dir in $(ls -d *);do
  echo "项目 ========================================================================================== ${dir}"
  cd $dir
  git branch -a | grep -v 'remotes/origin/HEAD' | grep 'remotes/origin/' | sed 's/.*remotes\/origin\///g' | xargs -I {} git checkout {}
  git push --all mine
  cd ..
done
#echo "工作目录: $1"
#cd $1 &&  echo "更新所有分支"
#git branch -a | grep -v 'remotes/origin/HEAD' | grep 'remotes/origin/' | sed 's/.*remotes\/origin\///g' | xargs -I {} git checkout {} && \\
#git push --all mine